/*
 * Copyright 2012 Gayan Perera
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/
package gap.maven.script.components.api;


import org.apache.maven.project.MavenProject;

/**
 * Factory instance which can be used to create POM and Artifact file objects. The implementation can be
 * taken by calling {@link ScriptContext#lookup(String)} with {@link ScriptContext#ARTIFACT_FILE_FACTORY_KEY}.
 * 
 * @author gayan
 */
public interface ArtifactFileFactory {

    public static final String SCRIPT_CONTEXT_KEY = "gap.maven.script.components.api.ArtifactFileFactory";
    
    
    /**
     * Creates a {@link ArtifactFile} instance with the given parameters.
     * 
     * @param groupId Group id of the artifact which cannot be empty or null.
     * @param artifactId Artifact id of the artifact which cannot be empty or null.
     * @param version Version of the artifact which cannot be empty or null.
     * @param type Type of the artifact which cannot be null. Passing empty will use "jar" as the default value.
     * @param classifier Classifier of the artifact which cannot be null. Passing empty will ignore this parameter.
     * @return An instance of {@link ArtifactFile}.
     */
    ArtifactFile createArtifactFile(String groupId, String artifactId, String version, String type, String classifier);

    /**
     * Creates a {@link ArtifactFile} instance with the given parameters.
     * 
     * @param groupId Group id of the artifact which cannot be empty or null.
     * @param artifactId Artifact id of the artifact which cannot be empty or null.
     * @param version Version of the artifact which cannot be empty or null.
     * @param type Type of the artifact which cannot be null. Passing empty will use "jar" as the default value.
     * @return An instance of {@link ArtifactFile}.
     */
    ArtifactFile createArtifactFile(String groupId, String artifactId, String version, String type);

    /**
     * Creates a {@link ArtifactFile} instance with the given parameters.
     * 
     * @param groupId Group id of the artifact which cannot be empty or null.
     * @param artifactId Artifact id of the artifact which cannot be empty or null.
     * @param version Version of the artifact which cannot be empty or null.
     * @return An instance of {@link ArtifactFile}.
     */
    ArtifactFile createMainArtifactFile(String groupId, String artifactId, String version);

    /**
     * Creates a {@link POMArtifactFile} instance with the given parameters.
     * 
     * @param groupId Group id of the artifact which cannot be empty or null.
     * @param artifactId Artifact id of the artifact which cannot be empty or null.
     * @param version Version of the artifact which cannot be empty or null.
     * @return An instance of {@link POMArtifactFile}.
     */
    POMArtifactFile createPOMFile(String groupId, String artifactId, String version);

    /**
     * Creates a {@link POMArtifactFile} instance with the given {@link MavenProject}.
     * 
     * @param project instance of {@link MavenProject} which cannot be null.
     * @return An instance of {@link POMArtifactFile}.
     */
    POMArtifactFile createPOMFile(MavenProject project);

}
